package com.jokul.controller;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

/**
 *@author: jokul
 *@2013-3-15 下午2:54:45
 */
@WebListener
public class OnlineUserCounter implements HttpSessionListener {

	private static int counter = 0;
	
	public static int getCounter() {
		return counter;
	}
	
	@Override
	public void sessionCreated(HttpSessionEvent se) {
		OnlineUserCounter.counter++;
	}

	@Override
	public void sessionDestroyed(HttpSessionEvent se) {
		OnlineUserCounter.counter--;
	}

}
